// Copyright 2010 The Go Example Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import "fmt"

//求数组的和
func sum(a []int) int { //返回 数组的和
	var s int = 0
	for i := 0; i < len(a); i++ {
		s += a[i]
	}
	return s
}
func main() {
	fmt.Print("Number:")

	n := [5]int{1, 2, 3, 4, 5}

	fmt.Println(n)

	s := sum(n[:])

	fmt.Printf("Sum: %d\n", s)
}
